apiVersion: batch/v1
kind: CronJob
metadata:
  name: updatepot
spec:
  concurrencyPolicy: Forbid
  schedule: "0 20 * * *"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  activeDeadlineSeconds: 900
  startingDeadlineSeconds: 300
  jobTemplate:
    spec:
      backoffLimit: 0
      template:
        metadata:
          labels:
            parent: "updatepotcron"
        spec:
          containers:
          - name: pushpot
            image: image-registry.openshift-image-registry.svc:5000/websites/builder:latest
            command: 
            - /bin/bash
            - /scripts/updatepot.sh
            volumeMounts: 
            - mountPath: /.gitconfig
              name: gitconfig
              readOnly: true
              subPath: .gitconfig
            - name: sshconfig
              mountPath: /.ssh
              readOnly: true
            - name: scripts
              mountPath: /scripts
          restartPolicy: Never
          startingDeadlineSeconds: 600
          volumes: 
          - name: sshconfig
            secret:
              secretName: sshconfig
          - name: gitconfig
            configMap:
              name: gitconfig
          - name: scripts
            configMap:
              name: updatepot-scripts
